{{> partials/menu}}
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
    <div class="col-sm-12">
        <h2>{{ @root.__ "Users" }} <span class="float-right"><a href="/admin/user/new" class="btn btn-outline-success">{{ @root.__ "New user" }}</a></span></h2>
    </div>
	<div class="col-md-12">
		<ul class="list-group">
			{{#each users}}
				<li class="list-group-item">
					<strong>{{ @root.__ "User" }}:</strong> {{this.usersName}} - ({{this.userEmail}})
					<span class="float-right">
						<strong>{{ @root.__ "Role" }}: </strong>
						{{#isAnAdmin this.isAdmin}}
							<span>Admin</span>
							{{#if ../this.isOwner}}
								(Owner)
							{{/if}}
						{{else}}
							<span>{{ @root.__ "User" }}</span>
						{{/isAnAdmin}}
						{{#isAnAdmin @root.session.isAdmin}}
							<a href="/admin/user/edit/{{../this._id}}">{{{feather 'edit'}}}</a>
							<a href="#" class="userDelete text-danger" data-id="{{../this._id}}">{{{feather 'trash-2'}}}</a>
						{{/isAnAdmin}}
					</span>
				</li>
			{{/each}}
		</ul>
	</div>
</main>